<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: aimath_f32.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('aimath__f32_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">aimath_f32.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Definition of the F32 (aif32) data-type.  
<a href="#details">More...</a></p>

<p><a href="aimath__f32_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ad3ffba87614778a1d8ee2314117ff59c"><td class="memItemLeft" align="right" valign="top">typedef float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__f32_8h.html#ad3ffba87614778a1d8ee2314117ff59c">aiscalar_f32_t</a></td></tr>
<tr class="memdesc:ad3ffba87614778a1d8ee2314117ff59c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scalar for F32 (aif32) data-type.  <a href="aimath__f32_8h.html#ad3ffba87614778a1d8ee2314117ff59c">More...</a><br /></td></tr>
<tr class="separator:ad3ffba87614778a1d8ee2314117ff59c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a35be372b71f7d1cbeffa157448fe7c31"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__f32_8h.html#a35be372b71f7d1cbeffa157448fe7c31">aimath_f32_print_aitensor</a> (const <a class="el" href="structaitensor.html">aitensor_t</a> *tensor)</td></tr>
<tr class="memdesc:a35be372b71f7d1cbeffa157448fe7c31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Printing a F32 tensor to console.  <a href="aimath__f32_8h.html#a35be372b71f7d1cbeffa157448fe7c31">More...</a><br /></td></tr>
<tr class="separator:a35be372b71f7d1cbeffa157448fe7c31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a71af5b0db68ff71ef6399f90f36cac"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__f32_8h.html#a5a71af5b0db68ff71ef6399f90f36cac">aimath_f32_print_aiscalar</a> (const void *scalar)</td></tr>
<tr class="memdesc:a5a71af5b0db68ff71ef6399f90f36cac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Printing a F32 scalar to console.  <a href="aimath__f32_8h.html#a5a71af5b0db68ff71ef6399f90f36cac">More...</a><br /></td></tr>
<tr class="separator:a5a71af5b0db68ff71ef6399f90f36cac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a06eea7384624233f57daab2648d8ce37"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structaimath__dtype.html">aimath_dtype_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">aif32</a></td></tr>
<tr class="memdesc:a06eea7384624233f57daab2648d8ce37"><td class="mdescLeft">&#160;</td><td class="mdescRight">The F32 data-type indicator.  <a href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">More...</a><br /></td></tr>
<tr class="separator:a06eea7384624233f57daab2648d8ce37"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Definition of the F32 (aif32) data-type. </p>
<dl class="section version"><dt>Version</dt><dd>2.2.0 </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2020-2023 Fraunhofer Institute for Microelectronic Circuits and Systems. All rights reserved.<br  />
<br  />
 AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br  />
<br  />
 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.<br  />
<br  />
 You should have received a copy of the GNU Affero General Public License along with this program. If not, see <a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>.</dd></dl>
<p>The F32 (aif32) data-type stores data as 32 bit single precision floating point values. It does not require any additional parameter to define the values.</p>
<p><b>Example: Create a F32 tensor</b><br  />
The tensor </p><p class="formulaDsp">
\[ \left( \begin{array}{rrr} 0 &amp; 1 &amp; 2 \\ 3 &amp; 4 &amp; 5 \end{array}\right) \]
</p>
<p> can be created with In C: </p><div class="fragment"><div class="line"><span class="keywordtype">float</span> example_data[] = {0.0f, 1.0f, 2.0f,</div>
<div class="line">                        3.0f, 4.0f, 5.0f};</div>
<div class="line">uint16_t example_shape[] = {2, 3};</div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> example_tensor = {</div>
<div class="line">    .<a class="code" href="structaitensor.html#abf7a461af7296a09d5246ca13591b988">dtype</a> = <a class="code" href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">aif32</a>,</div>
<div class="line">    .dim = 2,</div>
<div class="line">    .shape = example_shape,</div>
<div class="line">    .data = example_data</div>
<div class="line">};</div>
<div class="ttc" id="aaimath__f32_8h_html_a06eea7384624233f57daab2648d8ce37"><div class="ttname"><a href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">aif32</a></div><div class="ttdeci">const aimath_dtype_t * aif32</div><div class="ttdoc">The F32 data-type indicator.</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
<div class="ttc" id="astructaitensor_html_abf7a461af7296a09d5246ca13591b988"><div class="ttname"><a href="structaitensor.html#abf7a461af7296a09d5246ca13591b988">aitensor::dtype</a></div><div class="ttdeci">const aimath_dtype_t * dtype</div><div class="ttdoc">The datatype of the tensor, e.g.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:90</div></div>
</div><!-- fragment --><p> In C, C++ and on Arduino: </p><div class="fragment"><div class="line"><span class="keywordtype">float</span> example_data[] = {0.0f, 1.0f, 2.0f,</div>
<div class="line">                        3.0f, 4.0f, 5.0f};</div>
<div class="line">uint16_t example_shape[] = {2, 3};</div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> example_tensor = AITENSOR_2D_F32(example_shape, example_data);</div>
</div><!-- fragment --><p><b>Example: Create a F32 scalar</b><br  />
Either create it as a normal float value </p><div class="fragment"><div class="line"><span class="keywordtype">float</span> scalar = 42.0f;</div>
</div><!-- fragment --><p> or with the alias </p><div class="fragment"><div class="line"><a class="code" href="aimath__f32_8h.html#ad3ffba87614778a1d8ee2314117ff59c">aiscalar_f32_t</a> scalar = 42.0f;</div>
<div class="ttc" id="aaimath__f32_8h_html_ad3ffba87614778a1d8ee2314117ff59c"><div class="ttname"><a href="aimath__f32_8h.html#ad3ffba87614778a1d8ee2314117ff59c">aiscalar_f32_t</a></div><div class="ttdeci">float aiscalar_f32_t</div><div class="ttdoc">Scalar for F32 (aif32) data-type.</div><div class="ttdef"><b>Definition:</b> aimath_f32.h:120</div></div>
</div><!-- fragment --><p><b>Example: Print a F32 tensor to the console</b> </p><div class="fragment"><div class="line"><a class="code" href="aimath__basic_8h.html#ab10c8d06990943806f0be8fcc6af03fc">print_aitensor</a>(&amp;example_tensor);</div>
<div class="ttc" id="aaimath__basic_8h_html_ab10c8d06990943806f0be8fcc6af03fc"><div class="ttname"><a href="aimath__basic_8h.html#ab10c8d06990943806f0be8fcc6af03fc">print_aitensor</a></div><div class="ttdeci">void print_aitensor(const aitensor_t *tensor)</div><div class="ttdoc">Printing a tensor to console.</div></div>
</div><!-- fragment --><p><b>Example: Print a F32 scalar to the console</b> </p><div class="fragment"><div class="line"><a class="code" href="aimath__basic_8h.html#aaa9ca757028820849ef3dde13cc46565">print_aiscalar</a>(&amp;scalar, <a class="code" href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">aif32</a>);</div>
<div class="ttc" id="aaimath__basic_8h_html_aaa9ca757028820849ef3dde13cc46565"><div class="ttname"><a href="aimath__basic_8h.html#aaa9ca757028820849ef3dde13cc46565">print_aiscalar</a></div><div class="ttdeci">void print_aiscalar(const void *scalar, const aimath_dtype_t *dtype)</div><div class="ttdoc">Printing a scalar to console.</div></div>
</div><!-- fragment --> </div><h2 class="groupheader">Typedef Documentation</h2>
<a id="ad3ffba87614778a1d8ee2314117ff59c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3ffba87614778a1d8ee2314117ff59c">&#9670;&nbsp;</a></span>aiscalar_f32_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef float <a class="el" href="aimath__f32_8h.html#ad3ffba87614778a1d8ee2314117ff59c">aiscalar_f32_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Scalar for F32 (aif32) data-type. </p>
<p>This is only an alias for a float value for consistency.<br  />
You can create a F32 scalar either as a normal float value </p><div class="fragment"><div class="line"><span class="keywordtype">float</span> scalar = 42.0f;</div>
</div><!-- fragment --><p> or with the alias </p><div class="fragment"><div class="line"><a class="code" href="aimath__f32_8h.html#ad3ffba87614778a1d8ee2314117ff59c">aiscalar_f32_t</a> scalar = 42.0f;</div>
</div><!-- fragment --><p>You can print the scalar to the console with </p><div class="fragment"><div class="line"><a class="code" href="aimath__basic_8h.html#aaa9ca757028820849ef3dde13cc46565">print_aiscalar</a>(&amp;scalar, <a class="code" href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">aif32</a>);</div>
</div><!-- fragment --><p> or by using </p><div class="fragment"><div class="line"><a class="code" href="aimath__f32_8h.html#a5a71af5b0db68ff71ef6399f90f36cac">aimath_f32_print_aiscalar</a>(&amp;scalar, printf);</div>
<div class="ttc" id="aaimath__f32_8h_html_a5a71af5b0db68ff71ef6399f90f36cac"><div class="ttname"><a href="aimath__f32_8h.html#a5a71af5b0db68ff71ef6399f90f36cac">aimath_f32_print_aiscalar</a></div><div class="ttdeci">void aimath_f32_print_aiscalar(const void *scalar)</div><div class="ttdoc">Printing a F32 scalar to console.</div></div>
</div><!-- fragment --> 
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a5a71af5b0db68ff71ef6399f90f36cac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a71af5b0db68ff71ef6399f90f36cac">&#9670;&nbsp;</a></span>aimath_f32_print_aiscalar()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aimath_f32_print_aiscalar </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>scalar</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Printing a F32 scalar to console. </p>
<p>For users the function </p><div class="fragment"><div class="line"><a class="code" href="aimath__basic_8h.html#aaa9ca757028820849ef3dde13cc46565">print_aiscalar</a>(&amp;scalar, <a class="code" href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">aif32</a>);</div>
</div><!-- fragment --><p> is prefered.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*scalar</td><td>The scalar (type: float) to print. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a35be372b71f7d1cbeffa157448fe7c31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35be372b71f7d1cbeffa157448fe7c31">&#9670;&nbsp;</a></span>aimath_f32_print_aitensor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aimath_f32_print_aitensor </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>tensor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Printing a F32 tensor to console. </p>
<p>For users the function </p><div class="fragment"><div class="line"><a class="code" href="aimath__basic_8h.html#ab10c8d06990943806f0be8fcc6af03fc">print_aitensor</a>(&amp;tensor);</div>
</div><!-- fragment --><p> is prefered.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*tensor</td><td>The tensor to print. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a06eea7384624233f57daab2648d8ce37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06eea7384624233f57daab2648d8ce37">&#9670;&nbsp;</a></span>aif32</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structaimath__dtype.html">aimath_dtype_t</a>* aif32</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The F32 data-type indicator. </p>
<p>Use this variable to configure some element with the <a class="el" href="aimath__f32_8h.html">F32 </a> data-type, </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_1e5d3661ed79af157d57e64a38265d09.html">basic</a></li><li class="navelem"><a class="el" href="dir_90008ee2b0f86999412b56217da88d54.html">base</a></li><li class="navelem"><a class="el" href="dir_4fb15a30b37b64fdad6823e3082f73a4.html">aimath</a></li><li class="navelem"><a class="el" href="aimath__f32_8h.html">aimath_f32.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
